#include <gtest/gtest.h>
#include <proto_server_context.hpp>

TEST(context,set_get)
{
    server_context a;
    a.set("1","123");
    a.set("2","456");
    a.set("3",3);
    a.set("4",4.0f);
    a.set("5",5.0);
    a.set("b",false);
    a.set("bt",true);

    ASSERT_EQ(*a.get("1"),"123");
    ASSERT_EQ(*a.get("2"),"456");
    ASSERT_EQ(*a.get<int>("3"),3);
    ASSERT_EQ(*a.get<float>("4"),4.0f);
    ASSERT_EQ(*a.get<double>("5"),5.0);
    ASSERT_EQ(*a.get<bool>("b"),false);
    ASSERT_EQ(*a.get<bool>("bt"),true);
    ASSERT_FALSE(a.get("NOT EXSISTS"));
}